/**
 * admui-basic v2.1.0 (http://www.admui.com/)
 * Copyright 2015-2019 Admui Team
 * Licensed under the Admui License 1.1 (http://www.admui.com/about/license)
 */
(function($) {
  'use strict';

  $(function() {
    var $treeTable = $('.tree-table');
    var countRootElements = 20;
    var countDeep = 5;
    var i = 0;
    var j = 1;

    for (; i < countRootElements; i += 1) {
      $('<tr></tr>')
        .addClass('treegrid-' + i + '-0')
        .appendTo($treeTable)
        .html('<td>根节点 ' + i + '</td><td>其他信息</td>');

      for (; j < countDeep; j += 1) {
        $('<tr></tr>')
          .addClass('treegrid-' + i + '-' + j)
          .addClass('treegrid-parent-' + i + '-' + (j - 1))
          .appendTo($('.tree-table'))
          .html('<td>节点 ' + i + '-' + j + '</td><td>其他信息</td>');
      }
    }

    // 初始化树形表格
    $treeTable.treegrid($.concatCpt('treegrid'));
  });
})(jQuery);
